home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / MYMUD21.ZIP / MMUD21.ZIP / SOURCE / SOURCE.ZIP / HEADER.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-01-21  |  6.0 KB  |  170 lines

  1. {$I COPYRGHT.INC}
  2.  
  3. (*--------------------------------------------------------------------------*
  4.   This unit contains the general definitions for MyMUD
  5.  *--------------------------------------------------------------------------*)
  6. Unit Header;
  7. Interface
  8. Uses Dos;
  9.  
  10. Const MudName      = 'MyMUD';
  11.       MudVersion   = '2.1';
  12.  
  13. Const CompileDate = '21 Jan 1995';
  14.  
  15. Const Room_Type          = 0;      { Define an object as a ROOM      }
  16.       Thing_Type         = 1;      { Define an object as a THING     }
  17.       Exit_Type          = 2;      { Define an object as a EXIT      }
  18.       Player_Type        = 3;      { Define an object as a PLAYER    }
  19.       Drone_Type         = 4;      { Define an object as a DRONE     }
  20.  
  21.       Guest_Level        = 0;      { Lowest liveform/level        }
  22.       Player_Level       = 1;      { Normal players               }
  23.       Builder_Level      = 2;      { Extra Creational commands    }
  24.       Wizard_Level       = 3;      { More special commands        }
  25.       God_Level          = 4;      { Only one who can make wizards}
  26.  
  27.  
  28. { Sex Types }
  29.       No_Gender          = $00;
  30.       Neuter_Gender      = $01;
  31.       Female_Gender      = $02;
  32.       Male_Gender        = $03;
  33.  
  34.  
  35. { Room_Flags: Room types }
  36.       Temple_Room          = $0001; { Items can be sacreficed     }
  37.       Haven_Room           = $0002; { User is save from killing   }
  38.       Shop_Room            = $0004; { Items can be sold           }
  39.       Loud_Room            = $0008; { Other can hear whispers..   }
  40.  
  41. { Attr_Flags }
  42.       Link_Ok_Flag         = $0001;
  43.       Sticky_Flag          = $0002;
  44.       Teleport_Ok_Flag     = $0004;
  45.       Invisible_Flag       = $0008;
  46.       For_Sale_Flag        = $0010;
  47.       ChOwn_Ok_Flag        = $0020;
  48.  
  49. { System Flags }
  50.       Macro_Flag           = $0001;
  51.  
  52.  
  53.       SAY_TOKEN      = '"';
  54.       POSE_TOKEN     = ':';
  55.       WHISPER_TOKEN  = '>';
  56.       USE_TOKEN      = '/';
  57.  
  58.       MACRO_ESC      = '%';  {  %n %N    Username                 }
  59.                              {  %s %S    he/she/it    He/She/It   }
  60.                              {  %o %O    him/her/it   Him/Her/It  }
  61.                              {  %p %P    his/her/its  His/Her/Its }
  62.                              {  %m       * match replacement      }
  63.  
  64.       NOTHING              = -1;
  65.  
  66.       PENNY_RATE           = 10;
  67.       MAX_PENNIES          = 10000;
  68.       MAX_OBJECT_ENDOWMENT = 1000;
  69.  
  70.       LevelNames : Array[Guest_Level..God_Level] Of String[10] =
  71.                    (
  72.                     'Guest  ',
  73.                     'Player ',
  74.                     'Builder',
  75.                     'Wizard ',
  76.                     'God    '
  77.                    );
  78.  
  79.       ReadOnly           = $00;
  80.       WriteOnly          = $01;
  81.       ReadWrite          = $02;
  82.  
  83.       ShareCompatible    = $00;
  84.       ShareDenyAll       = $10;
  85.       ShareDenyWrite     = $20;
  86.       ShareDenyRead      = $30;
  87.       ShareDenyNone      = $40;
  88.  
  89.       Inheritance        = $80;
  90.  
  91.       Highlight          = #27'[0;1;37m';
  92.       LowLight           = #27'[0;37m';
  93.       InverseLight       = #27'[0;7m'#27'[2K';
  94.  
  95.  
  96.       DescMax            = 2*1024; { Maximal size of a LongRec.Length }
  97.  
  98. Type LongRec    = Record  { filepointer and length of a longtekst }
  99.        Start    : LongInt;
  100.        Length   : Word;
  101.      End;
  102.  
  103.      GenderType = (None,Neuter,Female,Male);
  104.      TextRecord = Array[0..DescMax] Of Char;
  105.      NameString = String[20];
  106.      PassString = String[40];
  107.  
  108.      ObjRecord    = Record
  109.        Name       : String;      { Object name                          }
  110.        Password   : PassString;  { Password for players                 }
  111.        Key        : PassString;  { Boolean key                          }
  112.  
  113.        Location   : Integer;     { Current location                     }
  114.        Contents   : Integer;     { Start of contents list               }
  115.        Exits      : Integer;     { Start of exits list                  }
  116.        Next       : Integer;     { continue list                        }
  117.        Owner      : Integer;     { Recordnumber of owner                }
  118.        Pennies    : Integer;     { Value/amound of pennies              }
  119.  
  120.        ObjType    : Byte;        { Thing, room, exit, player, Drone     }
  121.        ObjLevel   : Byte;        { Toad,player,builder,wizard,god       }
  122.  
  123.        GenFlags   : LongInt;     { System flags                         }
  124.  
  125.        Desc       : LongRec;     { Pointer to long description          }
  126.  
  127.        Fail       : LongRec;     { Pointer to fail string               }
  128.        Success    : LongRec;     { Pointer to Success string            }
  129.        OFail      : LongRec;     { Pointer to fail for others           }
  130.        OSuccess   : LongRec;     { Pointer to succes for others         }
  131.  
  132.        Macro      : LongRec;     { Macro language recs                  }
  133.  
  134.        Sex        : Byte;        { Sex of a player                      }
  135.        Room_Flags : LongInt;     { Room attributes                      }
  136.        Attr_Flags : LongInt;     { Thing attributes                     }
  137.  
  138.        Garbage    : Integer;     { Start of Garbage chain               }
  139.        Finger     : LongRec;     { Info record for @FINGER command      }
  140.  
  141.        Storage    : Array[0..9] of Integer; { Variables for macros      }
  142.  
  143.        Filler   : Array[1..83] of Byte;
  144.      End;
  145.  
  146. Var HomeDir : PathStr;
  147.     ProgName: String[8];
  148.     Dum     : String[10];
  149.  
  150.     MemMatch     : String; { Memory for RegExpr info between LowLevel and Out_Proc }
  151.     LastSentence : String; { Last usertyped sentence }
  152.     MacroString  : String; { Macro string, commands sep. by ^ }
  153.     InMacro      : Boolean;{ Running a macro now?             }
  154.  
  155. Implementation
  156.  
  157. Begin { Grab the HOMEDIR }
  158. MacroString:='';
  159. LastSentence:='';
  160. MemMatch:='';
  161.  
  162. HomeDir:=ParamStr(0);
  163. FSplit(HomeDir,HomeDir,ProgName,Dum);
  164. If GetEnv(ProgName)<>''
  165.    Then HomeDir:=GetEnv(ProgName);
  166. HomeDir:=FExpand(HomeDir);
  167. If HomeDir[Length(HomeDir)]<>'\'
  168.    Then HomeDir:=HomeDir+'\';
  169. End.
  170.